import { OmitType, PickType } from '@nestjs/swagger';
import { Punch } from '../entities/punch.entity';
import { IsArray, ValidateNested } from 'class-validator';
import { Type } from 'class-transformer';
import { CreatePunchFoodDto } from '../../punch-food/dto/punch-food.dto';
import { NutrientItem } from '../../entities';

export class CreatePunchDto extends PickType(Punch, ['mealType']) {
  /**
   * 打开的食物列表
   */
  @IsArray()
  // 验数组里的每一项
  @ValidateNested({ each: true })
  @Type(() => CreatePunchFoodDto)
  foodList: CreatePunchFoodDto[];
}
export class PunchToDayFoodSummaryDto {
  /**
   * 总的炎症指数
   */
  resultInflammationIndex: number;
  /**
   * 是否促炎
   * true 促炎; false 抗炎
   */
  isHealth: boolean = false;
  /**
   * 今日打卡次数
   */
  todayPunchCount: number;
  /**
   * 热量比例
   */
  caloriesRatio: number = 0;
  /**
   * 蛋白质比例
   */
  proteinRatio: number = 0;
  /**
   * 碳水化合物比例
   */
  carbsRatio: number = 0;
  /**
   * 脂肪比例
   */
  fatRatio: number = 0;
}
